import { defineStore } from "pinia";
import { ref } from "vue";

const KEY = "page-control";

/**
 * 页面控制器
 */
export const usePageControlStore = defineStore(KEY, () => {
  const code = ref("");

  function set(newCode: string) {
    code.value = newCode;
  }

  function get() {
    return code.value;
  }

  return {
    set,
    get,
  };
});
